package sctu.edu.java.year2016.team01.OurTeamProject.subroutine;

import sctu.edu.java.year2016.team01.OurTeamProject.subroutine.Register;

import javax.swing.*;
import java.awt.*;

/**
 * Created by Zero on 2016/6/25.
 */
public class RegisterSuccess extends JFrame {


    public void registerSuccess(String string){

        Register path=new Register();
        JFrame f = new JFrame();
        f.setLayout(null);
        f.setTitle("用户注册");
        f.setBounds(700, 350, 300, 200);
        Container con = f.getContentPane();
        JPanel pan = new JPanel();

        ImageIcon background = new ImageIcon(path.path() + "\\背景.png");
        JLabel label = new JLabel(background);
        label.setBounds(0, 0, 300, 200);
        JPanel imagePanel = (JPanel) f.getContentPane();
        imagePanel.setOpaque(false);
        f.getLayeredPane().add(label, new Integer(Integer.MIN_VALUE));


        JLabel title=new JLabel(string);
        title.setFont(new Font("宋体", Font.BOLD, 21));
        title.setForeground(Color.white);
        f.getContentPane().add(title);
        title.setBounds(100, 0, 200, 200);

        f.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
        con.add(pan);
        f.setVisible(true);

    }

    public void noSolution(){

        Register path=new Register();
        JFrame f = new JFrame();
        f.setLayout(null);
        f.setTitle("用户注册");
        f.setBounds(700, 350, 600, 400);
        Container con = f.getContentPane();
        JPanel pan = new JPanel();

        ImageIcon background = new ImageIcon(path.path() + "\\背景.png");
        JLabel label = new JLabel(background);
        label.setBounds(0, 0, 600, 400);
        JPanel imagePanel = (JPanel) f.getContentPane();
        imagePanel.setOpaque(false);
        f.getLayeredPane().add(label, new Integer(Integer.MIN_VALUE));


        JLabel title1=new JLabel("没有解决方案,");
        title1.setFont(new Font("宋体", Font.BOLD, 21));
        title1.setForeground(Color.white);
        f.getContentPane().add(title1);
        title1.setBounds(200, 200, 200, 40);

        JLabel title2=new JLabel("我们为你派遣专业人员...");
        title2.setFont(new Font("宋体", Font.BOLD, 21));
        title2.setForeground(Color.white);
        f.getContentPane().add(title2);
        title2.setBounds(200,225 , 300, 40);

        f.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
        con.add(pan);
        f.setVisible(true);


    }
}
